<!DOCTYPE html>
<html>
<head>
  <title><%= (params[:controller] + " " + params[:action]).titleize %> - RailsApp</title>
  <%= stylesheet_link_tag    "application" %>
  <%= stylesheet_link_tag    "scaffold" %>
  <%= stylesheet_link_tag    "ajax_pagination" %>
  <%= javascript_include_tag "jquery" %>
  <%= javascript_include_tag "jquery_ujs" %>
  <%= javascript_include_tag "json2" %>
  <%= javascript_include_tag "history" %>
  <%= javascript_include_tag "history.adapter.jquery" %>
  <%= javascript_include_tag "jquery.ba-bbq" %>
  <%= javascript_include_tag "jquery.url" %>
  <%= javascript_include_tag "ajax_pagination" %>
</head>
<body>
<div id="countajaxloading" style="display: none;">0</div>
<script type="text/javascript">
$(document).ready(function () {
  $(document).on("ajaxp:loading", function() { // increment hidden div every time something loads
    $("#countajaxloading").text((parseInt($("#countajaxloading").text(),10) + 1).toString());
  });
});
/*jQuery(document).ready(function () {
  alert($.ajax_pagination.version);
  $.ajax_pagination("").get("http://localhost:3000/pages/about");
});*/
</script>

<div style="float: right; min-width: 150px;">
<%= ajax_section :id => "count", :history => false do %>
  <%= render :template => "sessions/count" %>
<% end %>
</div>
<h1><%= ajax_link_to "AJAX Pagination Example Application", "broken link" %><!-- note the broken link is intentional, for testing purposes --></h1>
<%= ajax_links :section_id => "global", :class => "menu" do %>
  <ul>
    <li><%= link_to "Home", root_url %></li>
    <li><%= link_to "Changelog", changelog_url %></li>
    <li><%= link_to "Readme", pages_readme_url %></li>
    <li><%= link_to "About", pages_about_url %></li>
  </ul>
<% end %>
<%= ajax_section :reload => {:urlpart => "path", :urlregex => "^.*$"}, :loadzone => true do %>
  <%= render :template => "layouts/flash" %>
<% end %>
</body>
</html>
